<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;
/**
 * 说明
 * --------------------------------------------------------------------------------------+
 * 1. middleware('check') 后台登录验证中间件
 * 2. middleware('auth') 前台登录验证中间件
 * --------------------------------------------------------------------------------------+
 */
    Route::rule('/', 'lnadmin/index')->middleware('check');   // 后台首页
    Route::get('captcha/[:config]','\\think\\captcha\\CaptchaController@index');

    $controllerRoute = get_config('group_auth_rule.make_module');
   
        // 查找一级
        foreach (trim_array_element($controllerRoute) as $key => $val) 
        { 

      // 管理员路由组
            
        $actionRoute = get_config('action_code.un_make_module');

        foreach (trim_array_element($actionRoute) as $key => $value) { 
            
        if ( $value == 'login' || $value == 'authentication' || $value == 'authenticationcheck' ) {
           
      Route::any('' . $val . '/' . $value.'', '' . $val . '/' . $value. '');// 后台访问路由 

        } else {// 后台登录访问路由
          
      Route::any('' . $val . '/' . $value.'', '' . $val . '/' . $value. '')->middleware('check');
      
            }
         }  
      }
    
     // 屏蔽恶意请求路由
     Route::miss(function (){ return redirect('/403.html'); });